package cn.catsdad.base.entity;

import cn.catsdad.util.SnowflakeIdUtil;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;

/**
 * @author xuyl
 * @version 1.0 2024/6/23
 */
@Data
@Accessors(chain = true)
@MappedSuperclass
public abstract class BaseEntity implements Serializable {


    /**
     * 初始化填充雪花id
     */
    @Id
    private Long id = SnowflakeIdUtil.getSnowflakeId();
}
